using System;
using System.Collections.Generic;
using System.Text;

namespace WHSMailCommon.Entities
{
	// entity object representing an Email
	[Serializable]
	public class Email
	{
		private string _entryID;
		private string _from;
		private string _fromName;
		private string _subject;
		private DateTime _received;
		private int _size;
		private string _body;

		public Email(string entryID, string from, string fromName, string subject, DateTime received, int size)
		{
			_entryID = entryID;
			_from = from;
			_fromName = fromName;
			_subject = string.IsNullOrEmpty(subject) ? "(no subject)" : subject;
			_received = received;
			_size = size;
		}

		public Email(string entryID, string from, string fromName, string subject, DateTime received, int size, string body) :
			this(entryID, from, fromName, subject, received, size)
		{
			_body = body;
		}

		// MAPI unique ID
		public string EntryID
		{
			get { return _entryID; }
			set { _entryID = value; }
		}

		// email address of sender
		public string From
		{
			get { return _from; }
			set { _from = value; }
		}

		// name of sender
		public string FromName
		{
			get { return _fromName; }
			set { _fromName = value; }
		}

		public string Subject
		{
			get { return _subject; }
			set { _subject = value; }
		}

		public string Body
		{
			get { return _body; }
			set { _body = value; }
		}

		public DateTime Received
		{
			get { return _received; }
			set { _received = value; }
		}

		public int Size
		{
			get { return _size; }
			set { _size = value; }
		}
	}
}
